const express = require('express')
const router = express.Router()

//导入用户路由处理模块
const userHandler = require('../router_handler/user')

//验证数据的中间件
const expressJoi = require('@escook/express-joi')
//需要验证的规则对象
const { reg_register_schema, reg_login_schema } = require('../schema/user')

//注册
router.post('/register', expressJoi(reg_register_schema), userHandler.register)
//登录
router.post('/login', expressJoi(reg_login_schema), userHandler.login)

module.exports = router